package Model

import "time"

type Paycheck struct {
	itsPayPeriodStartDate time.Time
	itsPayPeriodEndDate   time.Time
	itsGrossPay           float64
	itsNetPay             float64
	itsDeductions         float64
	itsFields             map[string]string
}

func (pc *Paycheck) SetGrossPay(gp float64) {
	pc.itsGrossPay = gp
}

func (pc *Paycheck) SetDeductions(deductions float64) {
	pc.itsDeductions = deductions
}

func (pc *Paycheck) SetNetPay(netPay float64) {
	pc.itsNetPay = netPay
}

func (pc *Paycheck) SetFiled(name, value string) {
	pc.itsFields[name] = value
}

func (pc *Paycheck) GetPayPeriodEndDate() time.Time {
	return pc.itsPayPeriodEndDate
}

func (pc *Paycheck) GetPayPeriodStartDate() time.Time {
	return pc.itsPayPeriodStartDate
}

func (pc *Paycheck) GetGrossPay() float64 {
	return pc.itsGrossPay
}

func (pc *Paycheck) GetFiled(name string) string {
	return pc.itsFields[name]
}

func (pc *Paycheck) GetNetPay() float64 {
	return pc.itsNetPay
}

func (pc *Paycheck) GetDeductions() float64 {
	return pc.itsDeductions
}

func NewPaycheck(start, end time.Time) Paycheck {
	return Paycheck{itsPayPeriodStartDate: start, itsPayPeriodEndDate: end}
}
